package com.econ.powercloud.ems.common.enums;

/**
 * @ Description:
 * @ Author：hgp
 * @ Create:2023-02-08-16:43
 */
public enum DisplayType implements EnumMethod{
    NOT_DISPLAY(0,"不显示"),
    DISPLAY(1,"显示"),
    ;
    private Integer code;
    private String desc;
    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getDesc() {
        return this.desc;
    }

    DisplayType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(int code){
        for(DisplayType type: DisplayType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

    public static DisplayType fromCode(int code){
        for(DisplayType type: DisplayType.values()){
            if(type.getCode() == code){
                return type;
            }
        }
        return null;
    }
}
